<template>
  <div class="rivet-fixed">
    <div class="flex">
      <button class="pan-btn green-btn mini" @click="submit">
        {{ confirmTxt }}
      </button>
      <button v-if="!isBack" class="pan-btn pink-btn mini" @click="back">
        取 消
      </button>
    </div>
  </div>
</template>
<script>
export default {
  name: "SubmitBtn",
  props: {
    confirmTxt: {
      type: String,
      default: "确 认",
    },
    isBack: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    submit() {
      this.$emit("submit");
    },
    back() {
      this.$emit("back");
    },
  },
};
</script>

<style lang="scss" scoped>
.rivet-fixed {
  position: fixed;
  bottom: 20px;
  width: 10%;
  right: 3%;
  // // min-width: 1030px;
  height: 50px;
  border-radius: 10px;
  border: 1px solid #eee;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(2px);
  transition: all 0.2s;
  // line-height: 70px;
  z-index: 1;
  padding-top: 8px;
  &:hover {
    height: 70px;
    // line-height: 70px;
    background: rgba(245, 245, 245, 0.5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    padding-top: 25px;
  }
  &:hover button {
    transform: translate3d(0, -3px, 0) scale(1.2);
  }
  .flex {
    width: 100%;
    display: flex;
    text-align: center;
    justify-content: center;
    z-index: 1;
    > button {
      margin: 0 30px;
      transition: all 0.2s;
    }
  }
}
</style>